export const constantRouterMap = [
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login'),
        hidden: true
    },
    {
        path: '/display',
        name: 'display',
        meta: {
            title: '目标档案'
        },
        component: () => import('@/views/archives/index.vue')
    },
    {
        path: '/obj-show',
        name: 'obj-show',
        hidden: true,
        meta: {
            title: '对象查看',
            hidden: true
        },
        component: () => import('@/views/archives/analysis/index.vue')
    }
]
// 动态路由
export const asyncRouterMap = [
    {
        path: '/',
        name: 'index',
        component: () => import('@/views/layout'),
        redirect: '/home',
        children: [
            {
                path: 'home',
                name: 'home',
                meta: {
                    title: '系统首页'
                },
                component: () => import('@/views/home/newIndex.vue')
            },
            {
                path: 'workBench',
                name: 'workBench',
                meta: {
                    title: '目标管理'
                },
                component: () => import('@/views/workBench')
            },
            {
                path: 'search',
                name: 'search',
                meta: {
                    title: '目标搜索'
                },
                component: () => import('@/views/search')
            },
            {
                path: 'relationGraph',
                name: 'relationGraph',
                meta: {
                    title: '目标分析'
                },
                component: () => import('@/views/relationGraph/relationGraph')
            },
            {
                path: 'search-show',
                name: 'search-show',
                meta: {
                    title: '搜索页-显示'
                },
                component: () => import('@/views/search/search-show.vue')
            },
            {
                path: 'backStage',
                name: 'backStage',
                meta: {
                    title: '目标建模'
                },
                component: () => import('@/views/backStage')
            },
            {
                path: 'map',
                name: 'map',
                meta: {
                    title: '地图分析'
                },
                component: () => import('@/views/G_map')
            },
            {
                path: 'advanced-search',
                name: 'advanced-search',
                meta: {
                    title: '高级搜索'
                },
                component: () => import('@/views/search/advanced-search')
            },
            {
                path: 'advanced-search-show',
                name: 'advanced-search-show',
                meta: {
                    title: '高级搜索'
                },
                component: () => import('@/views/search/advanced-search-show')
            },
            {
                path: 'file-upload',
                name: 'file-upload',
                meta: {
                    title: '文件上传'
                },
                component: () => import('@/views/fileUpload/index')
            },
            {
                path: 'create-file',
                name: 'create-file',
                meta: {
                    title: '添加文件'
                },
                component: () => import('@/views/fileUpload/createFile')
            }
        ]
    },
    {
        path: '*', // 错误路由
        redirect: '/'
    }
]
// 所有上面定义的路由都要写在下面的routers里
export const routers = [...constantRouterMap, ...asyncRouterMap]
